<?php 
	function getPatern($str,$begin_key,$end_key){
		$vals = array();
		$keys = array();
		$val = '';
		$key = '';
		$count_key = 0;
		for($i=0;$i<strlen($str);$i++){
			if($str[$i] == $begin_key){
				//start key
				$key = $key.$str[$i];
				$count_key++;
				$vals[] = $val;
				$val = '';
			}else{
				if($count_key == 0){
					$val = $val.$str[$i];
				}else{
					$key = $key.$str[$i];
					$count_key++;
				}
			}
			if($str[$i] == $end_key){
				$keys[] = $key;
				$count_key = 0;
				$key = '';
			}
			
			
		}
		print_r($vals);
		print_r($keys);
	}
	$curl = curl_init('http://www.flashscore.com/x/feed/f_1_1326585600_1_en_1');
	curl_setopt($curl, CURLOPT_REFERER, 'http://www.flashscore.com');
	curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($curl, CURLOPT_POST, true);
	$datas  = curl_exec($curl);
	curl_close($curl);
	
	//echo $datas;
	$sub = substr($datas, 5,7);
	$end_key = $sub[6];
	$begin_key = $sub[0];
	echo "enkey:".$end_key.'->>>>>>>>.'.$sub;
	$e = explode($sub, $datas);
	echo "<pre>";
	echo "<br>";
// 	print_r($e);
	foreach ($e as $e1)	getPatern($e1,$begin_key,$end_key);
?>
